// Author: Fadi Almasri //A program to find the largest element in an array. #include using namespace std; int main() { int n; cout << "Enter the number of elements: "; cin >> n; int arr[n]; cout << "Enter the elements: "; for (int i = 0; i < n; i++) { cin >> arr[i]; } int max = arr[0]; for (int i = 1; i < n; i++) { if (arr[i] > max) { max = arr[i]; } } cout << "The largest element is: " << max << endl; return 0; }